<cfoutput>
	<fieldset>
		<legend>Select Albums</legend>
		<ul id="categories" class="filetree">
			<cfloop from="1" to="#ArrayLen( Request.smugTree )#" index="categoryIndex">
				<li class="closed">
					<span class="folder">
						<a href="http://#Session.user.NickName#.smugmug.com/#UrlEncodedFormat( Request.smugTree[categoryIndex].CategoryName )#">#Request.smugTree[categoryIndex].CategoryName#</a>
					</span>
					<ul>
						<cfif StructKeyExists( Request.smugTree[categoryIndex], "SubCategories" )>
							<cfloop from="1" to="#ArrayLen( Request.smugTree[categoryIndex].SubCategories )#" index="subcategoryIndex">
								<li class="closed">
									<span class="folder">
										<a href="http://#Session.user.NickName#.smugmug.com/#UrlEncodedFormat( Request.smugTree[categoryIndex].CategoryName )#/#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].SubCategoryID#">#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].SubCategoryName#</a>
									</span>
									<cfif StructKeyExists( Request.smugTree[categoryIndex].SubCategories[subcategoryIndex], "Albums" )>
										<ul>
										<cfloop from="1" to="#ArrayLen( Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums )#" index="subcatAlbumIndex">
											<li>
												<span class="file">
													<input type="checkbox" name="AlbumID" value="#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums[subcatAlbumIndex].AlbumID#" id="#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums[subcatAlbumIndex].AlbumID#" />
													<label for="#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums[subcatAlbumIndex].AlbumID#">
														<a href="http://#Session.user.NickName#.smugmug.com/gallery/#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums[subcatAlbumIndex].AlbumID#">#Request.smugTree[categoryIndex].SubCategories[subcategoryIndex].Albums[subcatAlbumIndex].AlbumTitle#</a>
													</label>
												</span>
											</li>
										</cfloop>
										</ul>
									</cfif>
								</li>
							</cfloop>
						</cfif>
						<cfif StructKeyExists( Request.smugTree[categoryIndex], "Albums" )>
							<cfloop from="1" to="#ArrayLen( Request.smugTree[categoryIndex].Albums )#" index="catAlbumIndex">
								<li>
									<span class="file">
										<input type="checkbox" name="AlbumID" value="#Request.smugTree[categoryIndex].Albums[catAlbumIndex].AlbumID#" id="#Request.smugTree[categoryIndex].Albums[catAlbumIndex].AlbumID#" />
										<label for="#Request.smugTree[categoryIndex].Albums[catAlbumIndex].AlbumID#">
											<a href="http://#Session.user.NickName#.smugmug.com/gallery/#Request.smugTree[categoryIndex].Albums[catAlbumIndex].AlbumID#">#Request.smugTree[categoryIndex].Albums[catAlbumIndex].AlbumTitle#</a>
										</label>
									</span>
								</li>
							</cfloop>
						</cfif>
					</ul>
				</li>
			</cfloop>
		</ul>
	</fieldset>
</cfoutput>